#pragma once
//SRMDIV2_450;
//SRMDIV1_250;
//2009/10/23 16:32:12
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class HuffmanDecoding
{
public:
	string decode(string archive, vector <string> dictionary)
	{
		string txt = "";
		string ret = "";
		for(int i=0; i<archive.size(); i++)
		{
			txt += archive[i];
			for(int j=0; j<dictionary.size(); j++)
			{
				if(txt == dictionary[j])
				{
					cout << txt << endl;
					ret += 'A' + j;
					txt.clear();
					break;
				}
			}
		}
		return ret;
	}
};
